﻿var reType = "Windows";
//登录方法


//维护用户页面点击提交方法
function AddEdit(datas) {
    var type = getCondition();

    alert(datas); return;
    if (Pwd != rePwd) {
        layer.msg("两次输入密码不一致");
    } else {
        //添加
        $.ajax({
            url: "../Basis/AddUser",
            type: "post",
            data: {data:datas},
            success: function (data) {
                if (data ==1) {
                    ClosePage();
                } else {
                    layer.msg(data);
                }
            }
        });
    }
}


//获取页面跳转时传输的值
function getCondition() {
    var type = location.search;
    type = type.substring(6, type.length);
    alert(type);
    return type;
}

//加载用户数据信息
function EditUserLoad(usCode) {
        $("#userCode").attr("readonly", "readonly");
        $("#userCode").val(usCode);
        $.ajax({
            url: "../Basis/getUserList",
            type: "post",
            data: JSON.stringify({ "userCode": usCode }),
            success: function (data) {
               
                var json = JSON.parse(data);
                json = json.data[0];
                $.each(json, function (name, value) {
                    $("input[ name='" + name + "']").val(value);
                });
                $("#userDep").select2("val", [json.userDep]);
                if (json.isAcc == 1) {
                    $("#userName").attr("readonly", "readonly");
                    $("#userDep").attr("disabled", "disabled");
                    $("#userPhone").attr("readonly", "readonly");
                }
            }
        });
 
}



